import AutoImport from 'unplugin-auto-import/vite'
import { defineConfig } from 'vite'
import path from 'path'
import react from '@vitejs/plugin-react-swc'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react(),
    AutoImport({
      eslintrc: {
        enabled: true,
        filepath: './.eslintrc-auto-import.json' //此文件为重新启动项目生成的文件
      },
      dts: './auto-imports.d.ts', //此文件配置保存后系统自动生成
      imports: [
        'react',
        'react-router',
        'react-router-dom',
        {
          axios: [['default', 'axios']],
          zxcvbn: [['default', 'zxcvbn']]
        }
      ],
      resolvers: [
        /* ... */
      ]
    })
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src')
    }
  }
})
